import express from 'express'
import User from "./src/user.js"
import List from "./src/list.js"
import loggerMiddleware from "./middleware/logger.js"

const app = express()
app.use(express.json()) // 支持请求参数中的json解析
app.use(loggerMiddleware) // 注册日志中间件

app.use('/user', User) // 注册路由模块
app.use('/list', List) // 注册路由模块

app.listen(3000, () => {
    console.log('Server is running on http://localhost:3000');
})